<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">

   var userId="${param.userId}";//用户ID
   
   var loginSign="${param.loginSign}";//登录签名
   
   var appType="${param.appType}";//APP类型
   
   var terminalType="${param.terminalType}"; //终端类型 APP或者POS
   
   var sign="";//登录签名
   
   var terminalId="${param.terminalId}";
   
   //从Android系统接收参数
   function getLoginInfo(_userId,_loginSign,_appType,_businessType,_terminalType,_terminalId){
	  

	   userId=_userId;
	   
	   loginSign=_loginSign;
	   
	   appType = _appType;
	   
	   terminalType=_terminalType;
	   
	   sign = MD5(loginSign+userId);
	   
	   terminalId=_terminalId;
	   
	   if(_businessType=="movie"){
		   
		   loadMovieInfo();
	   }
	   
	   if(_businessType=="game"){
		   goGamePage();
	   }
	   if(_businessType=="insurance"){
		   
		   goInsurePage();
	   }
	   
 	   if(_businessType=="airTicket"){
		   
 		    //alert(_userId);
 			getCityList();
	   }
 	  
 	   if(_businessType=="banner"){
 		    
 		  	cancelLoadingDialog();
 		  
			$("#register").css("display","none");
	
			if(appType=="android"){
				  
			   $("#buyDiv").css("display","block");
			}
	   }
 	   
 	  if(_businessType=="hotel"){//酒店
 		  
 	  }
 	  
 	  if(_businessType=="more"){//更多
		  //alert("TODO");
	  }
	   
   }

   
   //显示加载框
   function showLoadingDialog(){
	   
	   try{
		   
		   if(appType=="android" || appType==""){
			   
		   	   window.stub.showLoadingDialog();
		   	
		   }else if(appType=="ios"){
			   
			   
			   window.location.href="show:";
		   }
		   
	   }catch(e){
		   
		   
	   }
	   
   }
   
   //取消加载框
 function cancelLoadingDialog(){
	
	   try{
		   
		   if(appType=="android" || appType==""){
			   
			  
		   	   window.stub.cancelLoadingDialog();
		   	

				
		   	   
		   }else if(appType=="ios"){
			   
			   window.location.href="cancel:";

		   }
		   
	   }catch(e){
		   
		   
	   }
	   
  }
   
 /**
  * 验证手机
  */
 function isMobile(value) {
 	
 	var reg = /^0{0,1}(13[0-9]|15[0-9]|18[0-9])[0-9]{8}$/;
 	
 	return reg.test(value);
 	
 }
 
 /**
  * 验证是否为空
  */
 function isNull(text) {

 	var reg = /^\s*$/g;

 	if (reg.test(text)) {
 		
 		return true;
 		
 	} else {
 		
 		return false;
 		
 	}

 }
 
/**
 * 限制字数输入
 */
function limitNumber(field,countfield,maxlimit) {
	 if (field.value.length > maxlimit)
	 field.value = field.value.substring(0,maxlimit);
	 else
	 countfield.value = maxlimit - field.value.length;
}
  
</script>
